/*
 * @Descripttion:
 * @LastEditors: xzh
 * @LastEditTime: 2023-11-09 23:21:42
 */
import type { object_Inf } from "@/utils/typings/index.type";
import request from "@/utils/request";
import factoryManage_APi from "@/api/factoryManage";

/*
 * @Descripttion:模具基本信息接口类
 * @LastEditors: xzh
 * @LastEditTime: 2023-08-29 19:46:19
 */
export default class moldBaseInfo_APi extends factoryManage_APi {
  //#region 模具类型接口

  /**
   * @Author: xzh
   * @Descripttion:保存模具类型信息
   * @Param:
   * @param {object} data
   */
  static saveMoldType = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldType/SaveMouldType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除模具类型信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldType = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldType/DeleteMouldType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改模具类型状态
   * @Param:
   * @param {Array} data
   */
  static updateMoldTypeStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldType/UpdateMouldTypeStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具类型信息
   * @Param:
   * @param {number} id 模具类型主键
   */
  static getMoldTypeInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldType/GetMouldType",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取模具类型列表
   * @Param:
   */
  static getMoldTypeList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/MouldType/GetMouldTypeList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 模具状态接口

  /**
   * @Author: xzh
   * @Descripttion:保存模具状态信息
   * @Param:
   * @param {object} data
   */
  static saveMoldState = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/SaveMouldStatus",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除模具状态信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldState = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/DeleteMouldStatus",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具状态信息
   * @Param:
   * @param {number} id 模具状态主键
   */
  static getMoldStateInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/GetMouldStatus",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改模具类型状态
   * @Param:
   * @param {Array} data
   */
  static updateMoldStateStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/UpdateMouldStatusStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取模具状态列表
   * @Param:
   */
  static getMoldStateList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldStatus/GetMouldStatusList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 模具档案接口

  /**
   * @Author: xzh
   * @Descripttion:保存模具档案信息
   * @Param:
   * @param {object} data
   */
  static saveMoldArchives = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldInfo/SaveMouldInfo",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除模具档案信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldArchives = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldInfo/DeleteMouldInfo",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具档案信息
   * @Param:
   * @param {number} id 模具档案主键
   */
  static getMoldArchivesInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldInfo/GetMouldInfo",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具检索列表
   * @Param:
   * @param {object_Inf} data
   */
  static getMoldArchivesList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldInfo/GetMouldInfoList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  //#endregion

  //#region 模次信息
  /**
   * @Author: xzh
   * @Descripttion: 获取模次信息
   * @Param:
   * @param {number} id 模具主键
   */
  static getMoldNumInfo = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/MouldInfo/GetMouldNumber",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  //endregion
}
